-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Make hdfs function compatible with tensorflow-io and TensorFlow version earlier than 2.6 by using FileSystem in TensorFlow Env. Also support S3 and so on now. #281
Conversation
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_cpu.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/cuckoo_hashtable_op_gpu.cu.cc
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/cuckoo_hashtable_op_gpu.cu.cc
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_gpu.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_gpu.h
Outdated
Show resolved
Hide resolved
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_cpu.h
Outdated
Show resolved
Hide resolved
f278091
to
0323ee3
Compare
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_cpu.h
Outdated
Show resolved
Hide resolved
9642b5f
to
a65c567
Compare
a5fd535
to
36540ce
Compare
virtual void get(const K* d_keys, ValueType<V>* d_vals, bool* d_status, | ||
size_t len, ValueType<V>* d_def_val, cudaStream_t stream, | ||
bool is_full_size_default) const {} | ||
virtual size_t get_size(cudaStream_t stream) const { return 0; } | ||
virtual size_t get_capacity() const { return 0; } | ||
virtual void remove(const K* d_keys, size_t len, cudaStream_t stream) {} | ||
virtual void clear(cudaStream_t stream) {} | ||
virtual void remove(const K* d_keys, size_t len, cudaStream_t stream) const {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change here? remove & clear should not be const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
85f7ea8
to
6a37b0c
Compare
…w version earlier than 2.6 by using FileSystem in TensorFlow Env. Change hdfs file system to all file system. Now also support S3, local and so on. Also change Redis backend function to make it more low coupling with TF. Also modify GPU/CPU hash table code(rehashifneeded/dump/cpu insert) to make them more decoupled and stable.
tensorflow_recommenders_addons/dynamic_embedding/core/kernels/lookup_impl/lookup_table_op_gpu.h
Show resolved
Hide resolved
but for unknown reasons with nvhashtable, the insert may have unknowable consequences that result in NaN values for the training parameters. Avoid unknown errors by calling cudaDeviceSynchronize() for purposes such as cache synchronization before insert kernels luanching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Excellent job! Thanks, @MoFHeka ! |
Description
[feat] Make hdfs function compatible with tensorflow-io and TensorFlow version earlier than 2.6 by using FileSystem in TensorFlow Env.
After TF 2.6, TF file system was migrated from TF main repo to TF io repo. So when a TF add-on need to use file system, it's better to get file system pointer from TF env for compatibility.
Also support S3 and so on now.
Also add GPU/Redis backend implementation.
Also modify GPU/CPU hash table code(rehashifneeded/dump) to make them more decoupled.
An insert is typically performed after the rehash_if_needed call, but for unknown reasons with nvhashtable, the insert may have unknowable consequences that result in NaN values for the training parameters. Avoid unknown errors by calling cudaDeviceSynchronize() for purposes such as cache synchronization before insert kernels luanching.
Type of change
Checklist:
How Has This Been Tested?
Compile and unit test it in different TF version.